
function data_all_paginate(json_parse) {

      //console.log(json_parse)
      var numItems = json_parse['num']; // num item
      var perPage = 10;
      
      // now setup pagination
      $(json_parse['elements']).pagination({
            items: numItems,
            itemsOnPage: perPage,
            cssStyle: "",
            onPageClick: function(pageNumber) { // this is where the magic happens

                  // someone changed page, lets hide/show trs appropriately	
                  var showFrom = perPage * (pageNumber - 1);
                      
                  var showTo = showFrom + perPage;
                  //alert(" FROM - " + showFrom + " ==== To - " + showTo)
                  var div_wrapper_block = $('div.job_list');
                  // Block Div
                  div_wrapper_block.block({ 
                        message: '<img src="/images/loaders/3d_4.gif">'
                  });

                  $.ajax({
                        type: "POST",
                        url : set_url,
                        dataType : "json",
                        data : set_data,
                        success : function(e){
                              console.log(data)
                              var json_data = JSON.parse(data);
                              console.log(json_data)
                              var user_list = json_data['data'];
                              
                              var ret = "";
                              for(var i = 0; i < user_list.length; i++){
                                  $("body").data("data_" + user_list[i]['others']['encrypt_uID'],user_list[i]['user']); // Save to body.data
                                  ret += '<div class="span3" style="margin-left:0px !important;padding:0px 10px 0px 10px !important;">';            
                                      ret += '<div class="userCard">';
                                          ret += '<div class="image">';
                                              ret += user_list[i]['others']['img'];
                                          ret += '</div>';
                                          ret += '<div class="info" data-id="' + user_list[i]['others']['encrypt_uID'] + '">';
                                              ret += '<h3 class="user_name_list">' + capitalize(user_list[i]['user']['first_name']) + " " + capitalize(user_list[i]['user']['last_name']) + '</h3>';
                                              ret += '<p><strong>' + user_list[i]['user']['rRoleName'] + '</strong></p>';
                                              ret += '<button class="btn edit_user"><a href="#fModal" role="button" data-toggle="modal">Edit</a></button> ';
                                              ret += '<button class="btn remove_user">Remove</button>';
                                              //ret += '<button class="btn edit_users">Edit</button>';
                                              ret += '<div class="informer" style="width: 100%;text-align: right;">';
                                                  ret += '<span>';
                                                      if(user_list[i]['user']['bBrandCategory'] != null){
                                                          ret += user_list[i]['user']['bBrandCategory'];
                                                      }else{
                                                          ret += "None";
                                                      }
                                                  ret += '</span>';
                                              ret += '</div>';
                                          ret += '</div>';
                                      ret += '</div>';
                                  ret += '</div>';
                                  $("body").data("data_" + user_list[i])
                              }
                              $("#user_list").html(ret);
                              $("#numItems").val(json_data['count_users']);
                              limitText(".user_name_list", 14);
                              //$(elements).html(ret);
                              div_wrapper_block.unblock(); 
                        }
                  })
            }
      });
}


// Load All Job Post Public
function data_all(json_parse) {

      var elements = json_parse['set_html_element'];

      //job_post_all_paginate(json_parse);
      $('div.job_list').block({ 
            message: '<img src="/images/loaders/3d_4.gif">'
      });
      
      $.ajax({
            type: "POST",
            url : json_parse['set_url'],
            //dataType : "json",
            data : json_parse['set_data'],
            success : function(data){
                 
                              var json_data = JSON.parse(data);
                              console.log(json_data)
                              var user_list = json_data['data'];
                              
                              var ret = "";
                              for(var i = 0; i < user_list.length; i++){
                                  $("body").data("data_" + user_list[i]['others']['encrypt_uID'],user_list[i]['user']); // Save to body.data
                                  ret += '<div class="span3" style="margin-left:0px !important;padding:0px 10px 0px 10px !important;">';            
                                      ret += '<div class="userCard">';
                                          ret += '<div class="image">';
                                              ret += user_list[i]['others']['img'];
                                          ret += '</div>';
                                          ret += '<div class="info" data-id="' + user_list[i]['others']['encrypt_uID'] + '">';
                                              ret += '<h3 class="user_name_list">' + capitalize(user_list[i]['user']['first_name']) + " " + capitalize(user_list[i]['user']['last_name']) + '</h3>';
                                              ret += '<p><strong>' + user_list[i]['user']['rRoleName'] + '</strong></p>';
                                              ret += '<button class="btn edit_user"><a href="#fModal" role="button" data-toggle="modal">Edit</a></button> ';
                                              ret += '<button class="btn remove_user">Remove</button>';
                                              //ret += '<button class="btn edit_users">Edit</button>';
                                              ret += '<div class="informer" style="width: 100%;text-align: right;">';
                                                  ret += '<span>';
                                                      if(user_list[i]['user']['bBrandCategory'] != null){
                                                          ret += user_list[i]['user']['bBrandCategory'];
                                                      }else{
                                                          ret += "None";
                                                      }
                                                  ret += '</span>';
                                              ret += '</div>';
                                          ret += '</div>';
                                      ret += '</div>';
                                  ret += '</div>';
                                  $("body").data("data_" + user_list[i])
                              }
                              $("#user_list").html(ret);
                              $("#numItems").val(json_data['count_users']);
                              limitText(".user_name_list", 14);
//    $('.job_list').pajinate({
//	    num_page_links_to_display : 5,
//	    items_per_page : 10
//    });
                        $('div.job_list').unblock();
              
              
            }
      })
}